// component/tab-bar/index.js
const config = require('../../config')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    active: Number
  },

  /**
   * 组件的初始数据
   */
  data: {
    isFyApp: config.isFyApp,
    tabBarArray: config.tabBarArray(),
    activeColor: config.tabBarActiveColor,
    inactiveColor: config.tabBarInactiveColor
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChangeTabbar(event) {
      const index = event.detail
      this.triggerEvent('tabBarChange', {
        index,
        url: this.data.tabBarArray[index].pagePath
      })
    }
  }
})
